<template>
  <div class="container">
    <el-row>
      <el-col :span="4" v-for="(o, index) in 12">
        <el-card :body-style="{ padding: '5px'}" shadow="hover" style="margin:0 10px 13px 0 ">
          <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"
               class="image">
          <div style="padding-top: 10px;">
            <span>{{ title }}</span>
            <div class="bottom clearfix">
              <time class="time">{{ currentDate }}</time>
              <el-button type="text" class="button" @click="showVideo">
                <i class="el-icon-video-play"></i>
                <span class="plays">100</span>
              </el-button>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <el-row>
      <el-pagination
        @current-change="handleCurrentChange"
        layout="prev, pager, next"
        :total=total>
      </el-pagination>
    </el-row>
    <!--    视频-->
    <el-dialog :visible.sync="centerDialogVisible" :title=title width="50%">
      <VideoPlayer :video="link"></VideoPlayer>
    </el-dialog>
  </div>
</template>

<script>
import VideoPlayer from "@/components/VideoPlayer/index.vue";

export default {
  name: 'download',
  data() {
    return {
      title: '小米工厂',
      link: 'http://sw003f8g6.hd-bkt.clouddn.com/chaojigongc_01_1.mp4',
      centerDialogVisible: false,
      total: 40,
      currentDate: new Date().getFullYear()
    }
  },
  methods: {
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    showVideo() {
      this.centerDialogVisible = true
    }
  },
  components: {
    VideoPlayer
  }
}
</script>
<style scoped lang="scss">
.time, .plays {
  font-size: 13px;
  color: #999;
}


.bottom {
  margin-top: 13px;
  line-height: 13px;
}

.button {
  padding: 0;
  float: right;
}

.image {
  width: 100%;
  display: block;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both
}

</style>
